// pages/select_city/select_city.js
var app = getApp();
Page({
  data:{
    hot_citys:["重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","重庆市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市","邯郸市"],
    select:[],
    lists:["A","B","C","D","E","F","G","H","I","G","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
  },
  fix(e){
    var index = e.target.dataset.i;
    var cdata = this.data.select;
    cdata = [];
    cdata[index]=true;
    this.setData({
      select:cdata
    })
  },
  navto(e){
    var index = e.target.dataset.i;
    app.globalData.city=this.data.hot_citys[index];
    wx.switchTab({
      url: '../../pages/index/index',
    })  
  },
  tolist(){
    wx.navigateTo({
      url: "../../pages/list/list",
    })
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    var cdata = this.data.select;
    cdata[0]="重庆市";
    this.setData({
      select:cdata
    })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }
})